<template>
    <el-config-provider :locale="locale">
        <div class="app-container" v-watermark="watermark">
            <router-view></router-view>
        </div>
    </el-config-provider>
</template>

<script>
import { computed } from 'vue';
import { useStore } from 'vuex';
import { getLocales } from './locale';

export default {
    setup() {
        const store = useStore();
        // 获取全局语言类型
        const currentLang = computed(() => store.state.language);
        // 动态获取 element-plus 的语言包
        const locale = computed(() => getLocales(currentLang.value));

        return {
            watermark: 'sibionics-ui-next Demo',
            locale,
        };
    },
};
</script>